home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
tex-k
/
tex-k-archive.past
/
1994.11.gz
/
1994.11
/
000004_Yves.Arrouye@imag.fr_Wed Nov 2 10:32:57 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-11-30
|
5KB
Received: from imag.imag.fr by cs.umb.edu with SMTP id AA27738
(5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Wed, 2 Nov 1994 03:36:25 -0500
Received: from petole.imag.fr by imag.imag.fr with SMTP id AA06092
(5.65c8/IDA-1.4.4 for <tex-k@cs.umb.edu>); Wed, 2 Nov 1994 09:36:21 +0100
Received: by petole.imag.fr (NX5.67e/NX3.0S)
id AA04134; Wed, 2 Nov 94 09:32:57 +0100
Date: Wed, 2 Nov 94 09:32:57 +0100
From: Yves Arrouye <Yves.Arrouye@imag.fr>
Message-Id: <9411020832.AA04134@petole.imag.fr>
Received: by NeXT.Mailer (1.100)
Received: by NeXT Mailer (1.100)
To: tex-k@cs.umb.edu
Subject: xdvik-18d bug fixes (for PostScript handling)
The following patch fixes some problems in xdvik-18d:
1. The ps: special did not set the current point.
2. The ! special was not handled.
3. It was absolutely impossible to keep things in SDict. This last problem
has an unsatisfactory solution: currently, I changed the @fedspecial
procedure in order to save the interpreter state in xdvi$sav (as is done
in the ps*.c files). This effectively allows modification of the
dictionaries (even TeXDict, of course) but only during a bang special,
and has the obvious advantage that if the PS code is corrupted the saved
state will be bad... (I tried to clean the state first as was done in
the ps*.c files, but this does not work for all cases.)
Regarding the third problem, I would like to propose the removal of the
save/restore bracketing in xdvik code (and then also remove the reading trick
for sending unbracketed code). After all, dvips (on which this is based)
clearly states that using raw PostScript code is at the writer's risk, and this
should be sufficient: if the PS fails, then the display in xdvik should fail
too (which is what it does) but it is not necessary to oversecure the thing
up to a point where correct---though not dvips-compliant---PS code cannot be
executed anymore.
Another more secure solution to this problem would be the downloading of
a small error-handler in the interpreter memory: if some bad PS is sent, then
the error-handler would restore the prior-to-call state so that the preview
can continue under good conditions; however, if no errors are found, then the
new state of the interpreter will become the default error-recovery state.
Please comment on this problem and proposed solutions,
Yves.
P.S.: yes, I'll do the necessary modifications if needed.
diff -u --recursive xdvik-18d-orig/xdvik/psheader.txt xdvik-18d/xdvik/psheader.txt
--- xdvik-18d-orig/xdvik/psheader.txt Mon Oct 31 09:04:33 1994
+++ xdvik-18d/xdvik/psheader.txt Wed Nov 2 09:10:58 1994
@@ -244,7 +244,8 @@
% to the current position on the page.
/@beginspecial % - @beginspecial - -- enter special mode
- { SDict begin
+ {
+ SDict begin
/SpecialSave save N
gsave
normalscale
@@ -285,13 +286,28 @@
grestore SpecialSave restore
end
} N
+
+% xdvik special treatment for saving definitions made in SDict (while using
+% the bang special; try to guarantee that the dictionary stack is ok!
+% xdvik should not systematically bracket code within save/restore pairs,
+% anyway: such bracketing breaks a lot of code (many packages do change
+% TeXDict from with ps: specials for instance) and we should only guarantee
+% that bracketing is done within @beginspecial and @endspecial. -- YA
+
+/@xdvisavestate
+ {
+ /xdvi$sav save def
+ } N
+
/@defspecial
{
SDict begin
} N
+
/@fedspecial
{
end
+ @xdvisavestate
} B
%%% macros for tpic
diff -u --recursive xdvik-18d-orig/xdvik/special.c xdvik-18d/xdvik/special.c
--- xdvik-18d-orig/xdvik/special.c Sat Oct 8 21:11:57 1994
+++ xdvik-18d/xdvik/special.c Tue Nov 1 12:17:44 1994
@@ -711,7 +711,9 @@
/* Also raw PostScript, but no extra : to skip. */
#if PS
if (currwin.win == mane.win) {
- psp.drawbegin (currwin.base_x, currwin.base_y, cp);
+ /* Don't forget to give the currentpoint - YA, 31 Oct 94 */
+ psp.drawbegin (PXL_H - currwin.base_x, PXL_V - currwin.base_y,
+ cp);
psp.drawend ("");
}
#endif
@@ -850,6 +852,25 @@
static void
+bang_special(cp)
+ char *cp;
+{
+ bbox_valid = False;
+
+#if PS
+ if (currwin.win == mane.win) {
+ psp.drawbegin(PXL_H - currwin.base_x, PXL_V - currwin.base_y,
+ "@defspecial ");
+ /* talk directly with the DPSHandler here */
+ psp.drawraw(cp);
+ psp.drawend(" @fedspecial");
+ }
+#endif
+
+ /* nothing else to do--there's no bbox here */
+}
+
+static void
quote_special(cp)
char *cp;
{
@@ -928,6 +949,7 @@
else if (strcmp(command, "PSf") == 0) epsf_special(cp);
else if (strcmp(command, "psf") == 0) epsf_special(cp);
else if (*orig_cp == '"') quote_special(orig_cp + 1);
+ else if (*orig_cp == '!') bang_special(orig_cp + 1);
else if (!hush_spec_now)
Fprintf(stderr, "%s: special \"%s\" not implemented\n", prog,
orig_cp);